﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Roslyn.Compilers.CSharp;

namespace RoslynHelper
{
    public static class InvocationExpression
    {
        public static InvocationExpressionSyntax AddParameters(this InvocationExpressionSyntax node, IEnumerable<ArgumentSyntax> arguments)
        {
            return Syntax.InvocationExpression(
                node.Expression, 
                Syntax.ArgumentList(
                    node.ArgumentList.OpenParenToken,
                    SeparatedList.Create<ArgumentSyntax>(node.ArgumentList.Arguments.Union(arguments)),
                    node.ArgumentList.CloseParenToken));
        }
    }
}
